Skip to content

test: repair the extension-tests suite broken by the test/ rename - #135

Merged
LukasHirt merged 3 commits into
mainfrom
fix/extension-tests-suite
Sep 18, 2026
Merged

LukasHirt merged 3 commits into
mainfrom
fix/extension-tests-suite

Conversation

@LukasHirt

Copy link
Copy Markdown
Contributor

Summary

  • fix: integrate all ocis helper changes into the docs #119 renamed test/ to extension-tests/ (and flattened test/helpers/ into it) but left several things pointing at the old layout, so most of this suite has been silently dead ever since — always green because nothing ran:
    • package.json's test script still globbed test/*.test.js (matches nothing) → npm test ran zero tests, in CI too.
    • latest-alias.test.js, next-alias.test.js, static-files.test.js still require('./helpers/latest-versions'), which no longer exists.
    • latest-versions.js itself still walked up two directories to find content/ instead of one, so even a corrected require crashed with ENOENT.
  • Also fixes a test bug this surfaced once the suite actually started running: page-aliases.test.js walks the entire content/ tree for :page-aliases: entries, including content/ocis/8.0/, which is on disk but not in site.yml's ocis source list (only 8.1-8.3 render — site.yml's own comment says an unlisted version folder "could safely be deleted if outdated"). The test flagged that stale, never-published version as a dangling alias. Now it skips versions this build doesn't publish, matching the builtOrSkip pattern already used elsewhere in this suite.
  • Docs: fixed the same stale test/ path reference in AGENTS.md.

Found and fixed while working on #133 (the medium-zoom PR needed the suite to actually run for a new guard test to mean anything), split out here since it's unrelated to that feature.

Test plan

  • npm run antora && npm test: 51 tests run (up from 0), 50 pass, 1 skip, 0 fail.
  • Verified the ocis alias check still fails when a real published stub (8.1) is removed — it's not just skipping everything.

@LukasHirt
LukasHirt requested a review from a team as a code owner September 17, 2026 18:03
@LukasHirt LukasHirt self-assigned this Sep 17, 2026
#119 renamed test/ to extension-tests/ (and flattened test/helpers/
into extension-tests/) but left several things pointing at the old
layout: package.json's test script still globbed test/*.test.js (so
npm test silently ran zero tests, in CI too), latest-alias.test.js /
next-alias.test.js / static-files.test.js still required
./helpers/latest-versions, and latest-versions.js itself still walked
up two directories to find content/ instead of one. Net effect: most
of this suite has been dead since #119, always green because nothing
ran.

Signed-off-by: Lukas Hirt <info@hirt.cz>
Restoring npm test above turned this test back on, which surfaces it:
content/ocis/8.0 has a page-aliases entry but isn't in site.yml's ocis
source list (only 8.1-8.3 render; site.yml's own comment says an
unnamed version folder "could safely be deleted if outdated"). The
test walks the whole content/ tree, so it flagged that stale, never-
published version as a dangling alias. Skip versions this build
doesn't publish, matching the builtOrSkip pattern the rest of the
suite already uses; verified it still fails when a real published
stub (8.1) is removed.

Signed-off-by: Lukas Hirt <info@hirt.cz>
@LukasHirt
LukasHirt force-pushed the fix/extension-tests-suite branch from 67b61c2 to 7bf3ff6 Compare September 17, 2026 18:05
@LukasHirt LukasHirt changed the title fix: repair the extension-tests suite broken by the test/ rename test: repair the extension-tests suite broken by the test/ rename Sep 17, 2026
@LukasHirt
LukasHirt added this pull request to stack #136 September 17, 2026 18:07
@LukasHirt
LukasHirt removed this pull request from stack #136 September 17, 2026 18:07
oc-tmueller
oc-tmueller previously approved these changes Sep 18, 2026
@oc-tmueller
oc-tmueller added this pull request to stack #139 September 18, 2026 13:53
@oc-tmueller
oc-tmueller removed this pull request from stack #139 September 18, 2026 13:56
* feat: re-add mediumzoom as a tracked npm dependency

The previous vendored copy of medium-zoom.min.js was reverted (#131)
for missing dependency management. Install medium-zoom via npm so it
is tracked in package.json/package-lock.json (and covered by
Dependabot), and copy its prebuilt browser bundle into
ui/supplemental/js/vendor/ via a preantora/preantora-local script,
since the site has no client-side bundler of its own.

Signed-off-by: Lukas Hirt <info@hirt.cz>

* refactor: make sync-vendor-assets.js data-driven

Replace the two hardcoded copyFileSync calls with a VENDOR_FILES list,
so vendoring another package's browser build later means adding an
entry instead of writing a new script.

Signed-off-by: Lukas Hirt <info@hirt.cz>

* fix: address review on the medium-zoom vendoring approach

- Add a build-output guard (extension-tests/static-files.test.js) that
  fails loudly if ui/supplemental/js/vendor/ wasn't repopulated before
  the build (e.g. npx antora run directly, bypassing the preantora
  hook): today it publishes green with a 404'ing <script> and image
  zoom silently dead site-wide.
- Make scripts/sync-vendor-assets.js wipe js/vendor/ before
  repopulating it, so dropping an entry from VENDOR_FILES actually
  removes the stale file instead of leaving it on disk in any
  checkout that already had it.
- Narrow the CSS z-index selector to img.medium-zoom-image--opened
  (the class only the currently-zoomed clone gets) instead of the
  bare medium-zoom-image class, which stays on every bound image for
  as long as it's attached and would promote them all to z-index 1000
  the moment anything positions a doc image.
- Add `body >` to the overlay selector so our rule outranks the
  library's own .medium-zoom-overlay by specificity rather than by
  injection order, in case a future medium-zoom release adds its own
  z-index there.
- Document scripts/ and the generated ui/supplemental/js/vendor/ in
  README.md's layout tree.

Signed-off-by: Lukas Hirt <info@hirt.cz>

---------

Signed-off-by: Lukas Hirt <info@hirt.cz>
@LukasHirt
LukasHirt merged commit 696af88 into main Sep 18, 2026
4 checks passed
@LukasHirt
LukasHirt deleted the fix/extension-tests-suite branch September 18, 2026 15:34
kw-tmueller pushed a commit that referenced this pull request Sep 25, 2026
11.0 is `latest` and 10.16 is `previous`, so 10.15 is two lines out of
support and its tree is 1002 files / 55 MB that nothing links to from the
current documentation. It also costs a `config-docs-in-sync` leg on every
PR and every nightly run, cloning core's 10.15 branch to verify pages
nobody reads.

This follows the "Dropping a version" procedure in README.md. `site.yml`
needs no edit because it globs `content/server/*`; deletion is the only
way to unpublish a server version. Keeping the folder unlisted - the
shape used for ocis 7.3 and 8.0 - would not work here anyway, because
config-docs-in-sync iterates `content/server/*/` independently of
site.yml and would keep checking it.

`PUBLISHED_VERSIONS` in go-redirect.js and the version loop in
go-redirect.test.js are two independent hand-maintained lists, and the
suite fails on either one alone. Verified in both directions by reverting
one change at a time: `PUBLISHED_VERSIONS matches the built server version
segments` catches the first, `a published version segment is preserved for
per-version fidelity` the second. Legacy `go.php?to=` links under
/server/10.15/ now fall back to /server/latest/, which is what that list
exists to do.

The `latest` and `next` alias trees move on their own, and 10.15 appeared
in none of the `latest-*`/`previous-*`/`current-*` attributes, so
global-attributes.yml is untouched. `npm run antora && npm test` publishes
exactly 10.16, 11.0, latest and next under public/server/, 51 pass 0 fail.

The historical `== Changes in 10.15.x` sections in server_release_notes.adoc
stay - that page is an archive reaching back to 10.0.7 and is not tied to
which versions are published.

Two things README.md got wrong about its own procedure, found by following
it: it named `test/go-redirect.test.js`, which moved to `extension-tests/`
in #135 and holds a second list it did not mention, and it did not mention
the `sync/manifest.yml` row or the table in the README itself. Both are
now bookkeeping steps. Its example command names a version that still
exists, so it stays copy-pasteable.

Accepted cost, per step 4 of that procedure: nothing redirects a retired
version tree, so inbound https://doc.owncloud.com/server/10.15/... links
now reach the site 404 page.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
kw-tmueller pushed a commit that referenced this pull request Sep 25, 2026
Review follow-up to the version drop. Two more places named a path that
moved to extension-tests/ in #135, and one of them is the paragraph that
tells you how to *add* a server version:

`test/go-redirect.test.js` -> `extension-tests/go-redirect.test.js` in the
"Dev version numbers are provisional" note, plus the part it omitted. The
drift test compares PUBLISHED_VERSIONS against the published trees, so a
removal that misses either hand-maintained list fails. An addition does
not: add '11.1' to PUBLISHED_VERSIONS only and the drift test is happy,
while the version loop in the test file silently never covers the new
segment. The note now says to add it in both places and why.

`test/static-files.test.js` -> `extension-tests/static-files.test.js`,
same class of staleness, in the same blockquote.

The "Dropping a version" example is now `rm -r content/server/<version>`
rather than a concrete number. Naming a version that still exists made it
copy-pasteable, which is exactly the hazard: it is the one command in
these docs meant to be pasted, and pasting it deletes a live, supported
documentation tree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants